package com.zr.model;
// Generated 2016-10-27 9:52:16 by Hibernate Tools 4.3.1.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Point generated by hbm2java
 */
@Entity
@Table(name = "point", catalog = "logistics")
public class Point implements java.io.Serializable {

	private Integer pointId;
	private Province province;
	private String pointName;
	private Double pointProfit;
	private Set<PointPrice> pointPrices = new HashSet<PointPrice>(0);
	private Set<Cars> carses = new HashSet<Cars> (0);
	private Set<Area> areas = new HashSet<Area>(0);

	public Point() {
	}

	public Point(Province province, String pointName, Double pointProfit, Set pointPrices, Set carses, Set areas) {
		this.province = province;
		this.pointName = pointName;
		this.pointProfit = pointProfit;
		this.pointPrices = pointPrices;
		this.carses = carses;
		this.areas = areas;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "point_id", unique = true, nullable = false)
	public Integer getPointId() {
		return this.pointId;
	}

	public void setPointId(Integer pointId) {
		this.pointId = pointId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pro_id")
	public Province getProvince() {
		return this.province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

	@Column(name = "point_name")
	public String getPointName() {
		return this.pointName;
	}

	public void setPointName(String pointName) {
		this.pointName = pointName;
	}

	@Column(name = "point_profit", precision = 22, scale = 0)
	public Double getPointProfit() {
		return this.pointProfit;
	}

	public void setPointProfit(Double pointProfit) {
		this.pointProfit = pointProfit;
	}






	@OneToMany(fetch = FetchType.LAZY, mappedBy = "point")
	public Set<Area> getAreas() {
		return areas;
	}
	public void setAreas(Set<Area> areas) {
		this.areas = areas;
	}
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "point")
	public Set<PointPrice> getPointPrices() {
		return pointPrices;
	}

	public void setPointPrices(Set<PointPrice> pointPrices) {
		this.pointPrices = pointPrices;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "point")
	public Set<Cars> getCarses() {
		return carses;
	}

	public void setCarses(Set<Cars> carses) {
		this.carses = carses;
	}






}
